# 序列类型、字典类型和集合类型

numbers = [1, 2, 3, 4]
print(numbers[0])
print(numbers[1])
print(numbers[2])
print(numbers[3])

numbers[3] = 99
print(numbers[3])

names = ["张三", "李四", "王五"]
names[2] = "田七"
print(names[2])

numbers = (1, 2, 3, 4)
print(numbers[0])
print(numbers[1])
print(numbers[2])
print(numbers[3])

# numbers[3] = 99 # 会出错
zero_to_nine = range(10)
one_to_ten = range(1, 11)
one_three_five = range(1, 6, 2)

print(zero_to_nine[0])
print(one_to_ten[9])
print(one_three_five[1])


city = {"name": "南京", "population": 8000000}
print(city["name"])
print(city["population"])

city['name'] = "上海"
city['population'] = 20000000
print(city["name"])
print(city["population"])


number_list = [1, 2, 1, 2]
print(number_list)

number_set = {1, 2, 1, 2}
print(number_set)